class Artwork < ActiveRecord::Base
  has_and_belongs_to_many :galleries

  has_attached_file :image,
                    :path => ":rails_root/public/images/artworks/:class/:id/:style/:basename.:extension",
                    :url => "/images/artworks/:class/:id/:style/:basename.:extension",
                    :styles => { :thumb=> "144x144#" }


  validates_attachment_presence :image
  validates_presence_of :description
  
  class << self
    def types
      TYPES 
    end

    def picture
      TYPES[0]
    end

    private 
    TYPES =  %w(Picture)
  end
end
